{% extends 'blog/base.html' %}

{% block title %}博客首页{% endblock %}

{% block content %}

    <div class="container" style="height: 500px; ">
        <div class="row">
            <div class="col-md-9">
            {% if articles %}
                {% for article in articles %}
                    <h2><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></h2> <br>
                    <p>{{ article.body|truncatechars:180 }}</p>
                    <p>
                        <span>作者：{{ article.author }}</span>
                        <span>&nbsp;&nbsp;&nbsp;&nbsp;发布时间：{{ article.pub_date }}</span>
                        <span>&nbsp;&nbsp;&nbsp;&nbsp;阅读量：{{ article.views }}</span>
                    </p>
                {% endfor %}
            {% else %}
                <p>没有文章。</p>
            {% endif %}


            </div>

        </div>

    </div>


{% endblock %}